﻿using System;

namespace SharpDepend.Datatypes
{
    public struct BoolResult
    {
        public static readonly BoolResult Succeded = new BoolResult { Success = true };

        public bool Success;

        public Exception Error;

        public BoolResult(Exception error)
        {
            Error = error;
            Success = false;
        }

        public static bool operator true(BoolResult result)
        {
            return result.Success;
        }
        public static bool operator false(BoolResult result)
        {
            return !result.Success;
        }
    }
}
